<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">

<ui:composition template="/WEB-INF/templates/newsmaintemplate.xhtml">

	<ui:define name="leftpage">
		<!-- picture news -->
		<div class="block picNews">
			<h:form>
				<div class="rectacularPictureDiv">
					<h:commandLink onclick="switcher.previous();return false;" value="&lt;" id="prev">
					</h:commandLink>
					<p:tooltip for="prev" value="Previous" showEffect="fade" hideEffect="fade" />
					<h:commandLink onclick="switcher.next();return false;" value="&gt;" style="float:right;" id="next">
					</h:commandLink>
					<p:tooltip for="next" value="Next" showEffect="fade" hideEffect="fade" />
					<p:imageSwitch effect="fade" widgetVar="switcher" slideshowAuto="true" slideshowSpeed="3000">
						<ui:repeat value="#{mainDashBoardBackingBean.pictureNewsDB}" var="picNewsDashBoard">
							<h:panelGrid columns="1">
								<h:link outcome="/news/viewnews">
									<p:graphicImage url="#{picNewsDashBoard.picturePathURL}" styleClass="rectacularPicture"></p:graphicImage>
									<f:param name="id" value="#{picNewsDashBoard.newsId}"></f:param>
								</h:link>
								<h:link outcome="/news/viewnews" styleClass="longstyle" value="#{picNewsDashBoard.newsSubject}">
									<f:param name="id" value="#{picNewsDashBoard.newsId}"></f:param>
								</h:link>
							</h:panelGrid>
						</ui:repeat>
					</p:imageSwitch>
				</div>
				<div class="rectacularPictureDiv-Second">
					<ul>
						<p:dataList value="#{mainDashBoardBackingBean.pictureNewsDB}" var="picNewsDashBoard" type="none" itemType="disc" rows="10"
							styleClass="picnewsrightpart">
							<li><h:link outcome="/news/viewnews" styleClass="longstyle" value="#{picNewsDashBoard.newsSubject}">
									<f:param name="id" value="#{picNewsDashBoard.newsId}"></f:param>
								</h:link></li>
						</p:dataList>
					</ul>
				</div>
			</h:form>
		</div>

		<div class="section ">

			<!-- regular News -->
			<h:form>
				<p:dataGrid value="#{mainDashBoardBackingBean.regularNewsCategoryNameList}" var="categoryName" columns="2" styleClass="regularSection">
					<ol>
						<h:link value="#{categoryName}" outcome="/news/listnews" styleClass="sectionTitle">
							<f:param name="ctgtNewsId" value="#{mainDashBoardBackingBean.getRegularNewsDashBoard(categoryName).get(0).newsCategoryId}"></f:param>
						</h:link>
						<p:dataList value="#{mainDashBoardBackingBean.getRegularNewsDashBoard(categoryName)}" var="newsDB" type="none" effectSpeed="slow"
							styleClass="independentSection">
							<li class="medium"><h:panelGroup styleClass="txt" layout="block">
									<h:link value="#{newsDB.newsSubject}" outcome="/news/viewnews">
										<f:param name="id" value="#{newsDB.newsId}"></f:param>
									</h:link>
								</h:panelGroup></li>

						</p:dataList>
					</ol>
				</p:dataGrid>
			</h:form>

		</div>

		<div class="ad">
			<script type="text/javascript">
			<!--
				google_ad_client = 'ca-pub-8368630049697559';
				/* banner */
				google_ad_slot = '3239869337';
				google_ad_width = 468;
				google_ad_height = 60;
			//-->
			</script>
			<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
				
			</script>
		</div>

		<div class="section ">
			<!-- regular Thread -->
			<h:form>
				<p:dataGrid value="#{mainDashBoardBackingBean.regularThreadCategoryNameList}" var="categoryName" columns="2" styleClass="regularSection">
					<ol>
						<h:link value="#{categoryName}" outcome="/thread/listthreads" styleClass="sectionTitle">
							<f:param name="ctgtThdId" value="#{mainDashBoardBackingBean.getRegularThreadDashBoard(categoryName).get(0).categoryId}"></f:param>
						</h:link>
						<p:dataList value="#{mainDashBoardBackingBean.getRegularThreadDashBoard(categoryName)}" var="threadDB" type="none" effectSpeed="slow"
							styleClass="independentSection">
							<li class="medium"><h:panelGroup styleClass="txt" layout="block">
									<h:link value="#{threadDB.threadSubject}" outcome="/thread/viewthread">
										<f:param name="id" value="#{threadDB.threadId}"></f:param>
									</h:link>
								</h:panelGroup></li>
						</p:dataList>
					</ol>
				</p:dataGrid>
			</h:form>
		</div>
	</ui:define>
	<ui:define name="rightpage">
		<div class="section block">
			<h:form>
				<!-- Mixed news -->
				<div class="sectionHeader">
					<h:link value="#{msgs.mixNews}" outcome="/news/index" />
				</div>
				<ol>
					<ui:repeat value="#{mainDashBoardBackingBean.mixedNewsCategoryNameList}" var="categoryName">
						<p:dataList value="#{mainDashBoardBackingBean.getMixedNewsDashBoard(categoryName)}" var="newsDB" type="none" effectSpeed="slow"
							styleClass="mixedSection">
							<li class="medium"><h:panelGroup styleClass="txt" layout="block">
									<h:link value="[#{categoryName}]" outcome="/news/listnews">
										<f:param name="ctgtNewsId" value="#{newsDB.newsCategoryId}"></f:param>
									</h:link>
									<h:link value="#{newsDB.newsSubject}" outcome="/news/viewnews">
										<f:param name="id" value="#{newsDB.newsId}"></f:param>
									</h:link>
								</h:panelGroup></li>
						</p:dataList>

					</ui:repeat>
				</ol>
			</h:form>
		</div>
		<div class="ad">
			<script type="text/javascript">
			<!--
				google_ad_client = 'ca-pub-8368630049697559';
				/* square250x250 */
				google_ad_slot = '9023872078';
				google_ad_width = 250;
				google_ad_height = 250;
			//-->
			</script>
			<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
				
			</script>
		</div>
		<div class="section block">
			<h:form>
				<!-- Mixed Thread -->
				<div class="sectionHeader">
					<h:link value="#{msgs.mixThreads}" outcome="/category/index" />
				</div>
				<ol>
					<ui:repeat value="#{mainDashBoardBackingBean.mixedThreadCategoryNameList}" var="categoryName">
						<p:dataList value="#{mainDashBoardBackingBean.getMixedThreadDashBoard(categoryName)}" var="threadDB" type="none" effectSpeed="slow"
							styleClass="mixedSection">
							<li class="medium"><h:panelGroup styleClass="txt" layout="block">
									<h:link value="[#{categoryName}]" outcome="/thread/listthreads">
										<f:param name="ctgtThdId" value="#{threadDB.categoryId}"></f:param>
									</h:link>
									<h:link value="#{threadDB.threadSubject}" outcome="/thread/viewthread">
										<f:param name="id" value="#{threadDB.threadId}"></f:param>
									</h:link>
								</h:panelGroup></li>
						</p:dataList>

					</ui:repeat>
				</ol>
			</h:form>
		</div>
	</ui:define>
</ui:composition>
</html>